﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for SanPhamEntity
/// </summary>
public class SanPhamEntity
{

    private string maSP;
    private string tenSP;
    private int maLoai;
    private int nhaPhanPhoi;
    private int nhaSanXuat;
    private string hinhAnh;
    private DateTime ngayNhap;
    private int donGia;
    private int maDVT;
    private int soLuong;
    private string dacDiem;
    private string mota;
    private string anHien;
    public SanPhamEntity()
    { }
    public SanPhamEntity(string maSP, string tenSP, int maLoai, int nhaPhanPhoi, int nhaSanXuat, string hinhAnh, DateTime ngayNhap, int donGia, int maDVT, int soLuong, string dacDiem, string mota, string anHien)
    {
        this.maSP = maSP;
        this.tenSP = tenSP;
        this.maLoai = maLoai;
        this.nhaPhanPhoi = nhaPhanPhoi;
        this.nhaSanXuat = nhaSanXuat;
        this.hinhAnh = hinhAnh;
        this.ngayNhap = ngayNhap;
        this.donGia = donGia;
        this.maDVT = maDVT;
        this.soLuong = soLuong;
        this.dacDiem = dacDiem;
        this.mota = mota;
        this.anHien = anHien;
    }
    public string MaSP
    {
        get { return this.maSP; }
        set
        {
            if (value == null)
                throw new Exception("maSP not allow nullvalue.");
            this.maSP = value;
        }
    }
    public string TenSP
    {
        get { return this.tenSP; }
        set { this.tenSP = value; }
    }
    public int MaLoai
    {
        get { return this.maLoai; }
        set { this.maLoai = value; }
    }
    public int NhaPhanPhoi
    {
        get { return this.nhaPhanPhoi; }
        set { this.nhaPhanPhoi = value; }
    }
    public int NhaSanXuat
    {
        get { return this.nhaSanXuat; }
        set { this.nhaSanXuat = value; }
    }
    public string HinhAnh
    {
        get { return this.hinhAnh; }
        set { this.hinhAnh = value; }
    }
    public DateTime NgayNhap
    {
        get { return this.ngayNhap; }
        set { this.ngayNhap = value; }
    }
    public int DonGia
    {
        get { return this.donGia; }
        set { this.donGia = value; }
    }
    public int MaDVT
    {
        get { return this.maDVT; }
        set { this.maDVT = value; }
    }
    public int SoLuong
    {
        get { return this.soLuong; }
        set { this.soLuong = value; }
    }
    public string DacDiem
    {
        get { return this.dacDiem; }
        set { this.dacDiem = value; }
    }
    public string Mota
    {
        get { return this.mota; }
        set { this.mota = value; }
    }
    public string AnHien
    {
        get { return this.anHien; }
        set { this.anHien = value; }
    }
    public override string ToString()
    {
        return this.maSP + "; " + this.tenSP + "; " + this.maLoai + "; " + this.nhaPhanPhoi + "; " + this.nhaSanXuat + "; " + this.hinhAnh + "; " + this.ngayNhap + "; " + this.donGia + "; " + this.maDVT + "; " + this.soLuong + "; " + this.dacDiem + "; " + this.mota + "; " + this.anHien + "; ";
    }
    public override bool Equals(Object obj)
    {
        SanPhamEntity me = (SanPhamEntity)obj;
        bool ret = this.MaSP.Equals(me.MaSP);
        return ret;
    }
    public override int GetHashCode()
    {
        return this.MaSP.GetHashCode();
    }

}